package karaoke.modelo;

public class JsonResult {
	private String mensaje;
	private String tipoMsg;
	private String claseMsg;
	private final String tipos[] = {"warning", "error", "success", "info"};
	private final String clases[] = {"alert-block", "alert-error", "alert-success", "alert-info"};
	private final String tittle_messages[] = {
		"<strong>Alert block</strong> ", 
		"<strong>Error</strong> ", 
		"<strong>Success</strong> ", 
		"<strong>Information</strong> "	
	};
	private final String default_messages[] = {
		"<strong>Alert block</strong> Best check yo self, you're not looking too good.", 
		"<strong>Error</strong> Change a few things up and try submitting again.", 
		"<strong>Success</strong> You successfully read this important alert message.", 
		"<strong>Information</strong> This alert needs your attention, but it's not super important."
	};
	public final static int WARNING = 0;
	public final static int ERROR = 1;
	public final static int SUCCESS = 2;
	public final static int INFO = 3;
	
	/**
	 *   @tipoMsg:
	 *  0 = warning
	 *  1 = error
	 *  2 = success
	 *  3 = info
	 */
	public JsonResult(int tipoMsg, String mensaje) {
		this.mensaje = (mensaje.equals("")?default_messages[tipoMsg]:tittle_messages[tipoMsg]+mensaje);
		this.tipoMsg = tipos[tipoMsg];
		this.claseMsg = clases[tipoMsg];
	}
	
	public JsonResult() {
		// TODO Auto-generated constructor stub
	}
	
	public void addMenssage(int tipoMsg, String mensaje){
		this.mensaje = tittle_messages[tipoMsg]+mensaje;
		this.tipoMsg = tipos[tipoMsg];
		this.claseMsg = clases[tipoMsg];
	}
	
	public void addMenssage(int tipoMsg){
		this.mensaje = default_messages[tipoMsg];
		this.tipoMsg = tipos[tipoMsg];
		this.claseMsg = clases[tipoMsg];
	}

	public String getMensaje() {
		return mensaje;
	}

	public void setMensaje(String mensaje) {
		this.mensaje = mensaje;
	}

	public String getTipoMsg() {
		return tipoMsg;
	}

	public void setTipoMsg(String tipoMsg) {
		this.tipoMsg = tipoMsg;
	}

	public String getClaseMsg() {
		return claseMsg;
	}

	public void setClaseMsg(String claseMsg) {
		this.claseMsg = claseMsg;
	}
	
}
